import 'package:flutter/material.dart';

class MyGridViewTwo extends StatelessWidget {
  const MyGridViewTwo({super.key});

  @override
  Widget build(BuildContext context) {
    return GridView.count(
      crossAxisCount: 4,
      mainAxisSpacing: 10,
      crossAxisSpacing: 10,
      childAspectRatio: 0.8,
      children: List.generate(9, (index) {
        return Container(
          color: Colors.red,
        );
      }),
    );
  }
}


// class MyGridViewTwo extends StatelessWidget {
//   const MyGridViewTwo({super.key});

//   @override
//   Widget build(BuildContext context) {
//     return GridView.builder(
//       itemCount: 9,
//       // gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
//       //   crossAxisCount: 3,
//       //   mainAxisSpacing: 10,
//       //   crossAxisSpacing: 10,
//       //   childAspectRatio: 0.8,
//       // ),
//       gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
//         maxCrossAxisExtent: 150,
//         mainAxisSpacing: 10,
//         crossAxisSpacing: 10,
//         childAspectRatio: 0.8,
//       ),
//       itemBuilder: (context, index) {
//         return Container(
//           color: Colors.red,
//         );
//       },
//     );
//   }
// }

